import { createSSRApp } from "vue"
import * as Pinia from "pinia"
import App from "./App.vue"
import tmUi from "./uni_modules/tm-ui"
import zebraWwiper from './uni_modules/zebra-swiper'
import { createI18n } from "vue-i18n"
import { i18nConfig, translate } from "./locale"

const i18n = createI18n(i18nConfig)
export function createApp() {
  const app = createSSRApp(App)
  app.use(i18n)
  app.use(Pinia.createPinia())
  app.use(tmUi)
  app.use(zebraWwiper)

  app.config.globalProperties.$trans = translate

  return {
    app,
    Pinia,
  }
}
